<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/3/28
 * Time: 20:03
 */

namespace common\sources\write\valueserviceprohibit;

use Yii;
use common\models\craftsman\ValueServiceProhibit;

class ValueServiceProhibitAccess implements IValueServiceProhibitAccess
{
    public function addProhibit($data)
    {
        $connect  = Yii::$app->db;
        $queryBuilder = $connect->queryBuilder;
        $sql = $queryBuilder->batchInsert(ValueServiceProhibit::tableName(),['bus_id','task_commod_id','value_service_id','pro_name','pro_code','city_name','city_code','create_time'],$data);
        return $connect->createCommand($sql)->execute();
    }

    public function delProhibit($value_service_id)
    {
        return ValueServiceProhibit::deleteAll(['value_service_id' => $value_service_id]);
    }
}